cmake_minimum_required(VERSION 3.15)
project(cpp_gui)
set(CMAKE_CXX_STANDARD 17)


set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

# every project
file(GLOB SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/src3/*.cpp)
list(REMOVE_ITEM SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/src3/main.cpp) 
# list(REMOVE_ITEM SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/src3/newmain.cpp) 
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src3/include)

# every project dependence
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/glfw/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/glad/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/glm)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/imgui)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/freetype-2.10.0)

# output
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(${PROJECT_NAME} ${SRC_LIST})

# link
add_subdirectory(extern/glfw)
add_subdirectory(extern/glad)
add_subdirectory(extern/glm)
add_subdirectory(extern/imgui)
add_subdirectory(extern/freetype-2.10.0)

target_link_directories(${PROJECT_NAME} PRIVATE extern/glfw/src extern/glad/src extern/imgui extern/freetype-2.10.0)
# the last two library is system library
target_link_libraries(${PROJECT_NAME} glfw glad GL glut imgui freetype)